.class public Lcom/bitauto/autoeasy/bbs/Object/BbsCityListParser;
.super Ljava/lang/Object;
.source "BbsCityListParser.java"


# instance fields
.field private final FGID:Ljava/lang/String;

.field private final FIRSTCHAR:Ljava/lang/String;

.field private final FORUMAPP:Ljava/lang/String;

.field private final FORUMNAME:Ljava/lang/String;

.field private final GROUPCATEGORY:Ljava/lang/String;

.field private final LOGO:Ljava/lang/String;

.field private final MEMBERCOUNT:Ljava/lang/String;

.field private final POSTS:Ljava/lang/String;

.field private TAG:Ljava/lang/String;

.field private final TODAYPOSTS:Ljava/lang/String;

.field private final TOPIC:Ljava/lang/String;

.field private bbsInfoList:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;",
            ">;"
        }
    .end annotation
.end field

.field private url:Ljava/lang/String;


# direct methods
.method public constructor <init>(Ljava/lang/String;)V
    .locals 1
    .parameter "url"

    .prologue
    .line 43
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 25
    const-string v0, "todayposts"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsCityListParser;->TODAYPOSTS:Ljava/lang/String;

    .line 26
    const-string v0, "posts"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsCityListParser;->POSTS:Ljava/lang/String;

    .line 27
    const-string v0, "MemberCount"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsCityListParser;->MEMBERCOUNT:Ljava/lang/String;

    .line 29
    const-string v0, "topic"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsCityListParser;->TOPIC:Ljava/lang/String;

    .line 30
    const-string v0, "GroupCategory"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsCityListParser;->GROUPCATEGORY:Ljava/lang/String;

    .line 31
    const-string v0, "FirstChar"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsCityListParser;->FIRSTCHAR:Ljava/lang/String;

    .line 33
    const-string v0, "FGid"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsCityListParser;->FGID:Ljava/lang/String;

    .line 34
    const-string v0, "ForumApp"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsCityListParser;->FORUMAPP:Ljava/lang/String;

    .line 35
    const-string v0, "ForumName"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsCityListParser;->FORUMNAME:Ljava/lang/String;

    .line 37
    const-string v0, "logo"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsCityListParser;->LOGO:Ljava/lang/String;

    .line 40
    const-string v0, ""

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsCityListParser;->url:Ljava/lang/String;

    .line 41
    const-string v0, "CityListBbsInfoParser"

    iput-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsCityListParser;->TAG:Ljava/lang/String;

    .line 44
    iput-object p1, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsCityListParser;->url:Ljava/lang/String;

    .line 45
    return-void
.end method


# virtual methods
.method public Paser2Object()V
    .locals 9

    .prologue
    .line 49
    new-instance v6, Ljava/util/ArrayList;

    invoke-direct {v6}, Ljava/util/ArrayList;-><init>()V

    iput-object v6, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsCityListParser;->bbsInfoList:Ljava/util/ArrayList;

    .line 51
    :try_start_0
    iget-object v6, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsCityListParser;->url:Ljava/lang/String;

    invoke-static {v6}, Lcom/bitauto/autoeasy/tool/Caller;->doGet(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    .line 52
    .local v5, str:Ljava/lang/String;
    new-instance v4, Lorg/json/JSONObject;

    invoke-direct {v4, v5}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 54
    .local v4, jObject:Lorg/json/JSONObject;
    const-string v6, "tablelist"

    invoke-virtual {v4, v6}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v6

    const-string v7, "Table"

    invoke-virtual {v6, v7}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v3

    .line 55
    .local v3, jArray:Lorg/json/JSONArray;
    const/4 v2, 0x0

    .local v2, i:I
    :goto_0
    invoke-virtual {v3}, Lorg/json/JSONArray;->length()I

    move-result v6

    if-lt v2, v6, :cond_0

    .line 69
    .end local v2           #i:I
    .end local v3           #jArray:Lorg/json/JSONArray;
    .end local v4           #jObject:Lorg/json/JSONObject;
    .end local v5           #str:Ljava/lang/String;
    :goto_1
    return-void

    .line 56
    .restart local v2       #i:I
    .restart local v3       #jArray:Lorg/json/JSONArray;
    .restart local v4       #jObject:Lorg/json/JSONObject;
    .restart local v5       #str:Ljava/lang/String;
    :cond_0
    invoke-virtual {v3, v2}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v6

    invoke-virtual {p0, v6}, Lcom/bitauto/autoeasy/bbs/Object/BbsCityListParser;->createBbsInfo(Lorg/json/JSONObject;)Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;

    move-result-object v0

    .line 57
    .local v0, bbsInfo:Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;
    if-eqz v0, :cond_1

    .line 58
    iget-object v6, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsCityListParser;->bbsInfoList:Ljava/util/ArrayList;

    invoke-virtual {v6, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catch Lcom/bitauto/autoeasy/tool/WSError; {:try_start_0 .. :try_end_0} :catch_1

    .line 55
    :cond_1
    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    .line 61
    .end local v0           #bbsInfo:Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;
    .end local v2           #i:I
    .end local v3           #jArray:Lorg/json/JSONArray;
    .end local v4           #jObject:Lorg/json/JSONObject;
    .end local v5           #str:Ljava/lang/String;
    :catch_0
    move-exception v6

    move-object v1, v6

    .line 62
    .local v1, e:Ljava/lang/Exception;
    const/4 v6, 0x0

    iput-object v6, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsCityListParser;->bbsInfoList:Ljava/util/ArrayList;

    .line 63
    iget-object v6, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsCityListParser;->TAG:Ljava/lang/String;

    new-instance v7, Ljava/lang/StringBuilder;

    const-string v8, "error :"

    invoke-direct {v7, v8}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1}, Ljava/lang/Exception;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-static {v6, v7}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 64
    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_1

    .line 65
    .end local v1           #e:Ljava/lang/Exception;
    :catch_1
    move-exception v6

    move-object v1, v6

    .line 67
    .local v1, e:Lcom/bitauto/autoeasy/tool/WSError;
    invoke-virtual {v1}, Lcom/bitauto/autoeasy/tool/WSError;->printStackTrace()V

    goto :goto_1
.end method

.method public createBbsInfo(Lorg/json/JSONObject;)Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;
    .locals 5
    .parameter "obj"

    .prologue
    const-string v2, "FirstChar"

    .line 72
    new-instance v0, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;

    invoke-direct {v0}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;-><init>()V

    .line 74
    .local v0, bbsInfo:Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;
    :try_start_0
    const-string v2, "FGid"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setFGid(Ljava/lang/String;)V

    .line 75
    const-string v2, "\u5176\u4ed6"

    const-string v3, "FirstChar"

    invoke-virtual {p1, v3}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_0

    .line 76
    const-string v2, "#"

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setFirstChar(Ljava/lang/String;)V

    .line 80
    :goto_0
    const-string v2, "ForumApp"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setForumApp(Ljava/lang/String;)V

    .line 81
    const-string v2, "ForumName"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setForumName(Ljava/lang/String;)V

    .line 82
    const-string v2, "GroupCategory"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setGroupCategory(Ljava/lang/String;)V

    .line 83
    const-string v2, "MemberCount"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setMemberCount(Ljava/lang/String;)V

    .line 84
    const-string v2, "posts"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setPosts(Ljava/lang/String;)V

    .line 85
    const-string v2, "todayposts"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setTodayposts(Ljava/lang/String;)V

    .line 86
    const-string v2, "topic"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setTopic(Ljava/lang/String;)V

    .line 87
    const-string v2, "logo"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setLogo(Ljava/lang/String;)V

    move-object v2, v0

    .line 92
    :goto_1
    return-object v2

    .line 78
    :cond_0
    const-string v2, "FirstChar"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;->setFirstChar(Ljava/lang/String;)V
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 89
    :catch_0
    move-exception v2

    move-object v1, v2

    .line 90
    .local v1, e:Lorg/json/JSONException;
    const-string v2, "BbsInfoParser"

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "error :"

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1}, Lorg/json/JSONException;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 91
    invoke-virtual {v1}, Lorg/json/JSONException;->printStackTrace()V

    .line 92
    const/4 v2, 0x0

    goto :goto_1
.end method

.method public getBbsInfoList()Ljava/util/ArrayList;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/bbs/Object/BbsInfo;",
            ">;"
        }
    .end annotation

    .prologue
    .line 22
    iget-object v0, p0, Lcom/bitauto/autoeasy/bbs/Object/BbsCityListParser;->bbsInfoList:Ljava/util/ArrayList;

    return-object v0
.end method
